<template>
	<view class="container" style="height: 100%;width: 100%;position: relative;overflow: hidden;">
		<uni-nav-bar :statusBar="true" :fixed="true" :border='false' color="#113A62" backgroundColor="#E3EDF7" left-icon="back"
			 title="加班单明细" @clickLeft="back"/>
		<view style="height: 100%;width: 100%;position: relative;padding: 0 16px;box-sizing: border-box;">
			<view style="width: 100%;margin: 0px auto;overflow: hidden">
				<form class="form-warp" @submit="formSubmit">
					<view style="margin-top: 16px;" class="textSize">
						场地
					</view>
					<view class="input-group">
						<input disabled v-model="buildingName" name="buildingName" placeholder="场地" />
						<!-- <ep-select v-model="siteNameNo" :options="siteNameList" @change="labChange"></ep-select> -->
					</view>
					<view style="margin-top: 16px;" class="textSize">
						实验室
					</view>
					<view class="input-group">
						<input disabled v-model="flevelNo" name="buildingName" placeholder="实验室" />
						<!-- <ep-select v-model="flevelNo" :options="flevelList" @change="labChange"></ep-select> -->
						<!-- <uni-down-select :data="flevelList" placeholder="请选择实验室" :value="flevelValue"  @change="labChange"></uni-down-select> -->
					</view>
					<view style="margin-top: 16px;" class="textSize">
						日期
					</view>
					<view class="input-group">
						<uni-datetime-picker disabled type="date" :clear-icon="false" v-model="workDate"/>
					</view>
					<view style="margin-top: 16px;" class="textSize">
						具体时间
					</view>
					<view class="input-group">
						<view style="display: flex;justify-content: space-between;align-items: center;">
							<uni-datetime-picker disabled :hide-second='false' class="time" type="time" :clear-icon="false" v-model="workBenTime"/>
								<text class="timezhi">至</text>
							<uni-datetime-picker disabled :hide-second='false' class="time" type="time" :clear-icon="false" :value="workEndTime"/>
						</view>
					</view>
					<view style="margin-top: 16px;" class="textSize">
						备注
					</view>
					<view class="input-group">
						<uni-easyinput disabled type="textarea" v-model="note" placeholder="请输入备注" />
					</view>
				</form>
			</view>
			<view @click="back" class="cencel">
				返回
			</view>
		</view>
	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				buildingName: '',
				flevelNo:'',
				workDate: '',  // 日期
				workBenTime: '',  // 开始时间
				workEndTime: '',  // 结束时间
				note: '', // 备注
			}
		},
		onLoad(e) {
			that = this;
			let ds
			try {
				ds = JSON.parse(decodeURIComponent(e.item));
			} catch (error) {}
			that.buildingName = ds.ftowername
			that.flevelNo = ds.fpointName
			that.workDate = that.getDate(ds.fbegdate)
			that.workEndTime = ds.fendtime 
			that.workBenTime = ds.fbegtime
			that.note = ds.fnote
			console.log('ds',ds)
		},
		methods: {
			getDate(e) {
					const date = new Date(e)
					var y = date.getFullYear();
					var m = date.getMonth() + 1;
					m = m < 10 ? ('0' + m) : m;
					var d = date.getDate();
					d = d < 10 ? ('0' + d) : d;
					var h = date.getHours();
					var minute = date.getMinutes();
					minute = minute < 10 ? ('0' + minute) : minute;
					return y + '-' + m + '-' + d
			},
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style>
	.cencel{
		width: 100%;
		height: 56px;
		line-height: 56px;
		background: #E3EDF7;
		/* outer2 */
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 17px;
		/* identical to box height, or 100% */
		text-align: center;
		letter-spacing: -0.4px;
		color: #8B9EB0;
		margin: 16px 0;
	}
	.confirm{
		width: 45%;
		height: 56px;
		line-height: 56px;
		background: #0F7CEA;
		border-radius: 4px;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 20px;
		/* identical to box height, or 100% */
		text-align: center;
		letter-spacing: -0.4px;
		color: #FFFFFF;
	}
	.timezhi{
		/* Subtitle */
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 14px;
		line-height: 22px;
		color: #8B9EB0;

	}
	/* 遮罩层 */
	.shadow{
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		width: 100%;
		height: 100%;
		background: #FAFCFD;
		opacity: 0.85;
	}
	.success{
		width: 96%;
		height: 116px;
		background: linear-gradient(0deg, rgba(225, 255, 220, 0.5), rgba(225, 255, 220, 0.5)), #E3EDF7;
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		margin: auto;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		box-sizing: border-box;
		padding: 16px;
	}
	.error{
		width: 96%;
		height: 116px;
		background: linear-gradient(0deg, rgba(255, 40, 40, 0.2), rgba(255, 40, 40, 0.2)), #FFFFFF;
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		margin: auto;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		box-sizing: border-box;
		padding: 16px;
	}
	.success_title{
		width: 100%;
		display: flex;
		justify-content: space-between;
		/* padding: 18px; */
	}
	.success_text{
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 400;
		font-size: 18px;
		line-height: 28px;
		color: #113A62;
		margin-left: 10px;
	}
	.success_content{
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 400;
		font-size: 16px;
		line-height: 24px;
		color: #113A62;
		margin-top: 6px;
	}
	.next{
		width: 100%;
		height: 48px;
		text-align: center;
		line-height: 48px;
		background: #E3EDF7;
		/* outer2 */
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 20px;
		letter-spacing: -0.4px;
		color: #8B9EB0;
		margin-top: 60px;
	}
	.pwd_title{
		width: 100%;
		text-align: center;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 20px;
		line-height: 40px;
		/* identical to box height, or 167% */
		color: #113A62;
		margin-top: 15px;
	}
	.pwd_all{
		width: 86%;
		margin: auto;
		height: 282px;
		background: #E3EDF7;
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		padding: 16px;
	}
	.pwd_newall{
		width: 86%;
		margin: auto;
		height: 372px;
		background: #E3EDF7;
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		padding: 16px;
	}
	.loginOut{
		width: 92%;
		margin: 16px auto;
		height: 56px;
		line-height: 64px;
		background: #E3EDF7;
		/* outer2 */
		box-shadow: 2px 2px 4px rgba(114, 142, 171, 0.1), -6px -6px 20px #FFFFFF, 4px 4px 20px rgba(111, 140, 176, 0.41);
		border-radius: 4px;
		margin-bottom: 16px;
		
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 18px;
		/* identical to box height, or 100% */
		text-align: center;
		letter-spacing: -0.4px;
		color: #113A62;
		opacity: 0.6;
	}
	
	.form-warp {
		zoom: 1;
	}
	
	.form-warp:after {
		clear: both;
		display: block;
		visibility: hidden;
		height: 0;
		content: '\20'
	}
	
	.input-group {
		position: relative;
		margin-top: 8px;
	}
	
	.input-group .uni-icons {
		width: 48rpx;
		height: 48rpx;
		position: absolute;
		left: 48rpx;
		top: 20rpx;
		border-right: 1rpx solid #dedede;
		padding-right: 10rpx;
		font-size: 30rpx !important;
	}
	
	.input-group input {
		padding: 0 20rpx 0 120rpx;
		height: 90rpx;
		line-height: 90rpx;
		margin-bottom: 25px;
		background: #ffffff;
		font-size: 28rpx;
		border-radius: 50rpx;
	}
	
	/*解决光标大小不一致问题*/
	.uni-input-input {
		height: 100%;
		line-height: normal;
	}
	
	.account{
		/* Subtitle */
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 600;
		font-size: 14px;
		line-height: 22px;
		/* identical to box height, or 157% */
		display: flex;
		align-items: center;
		color: #8B9EB0;
		margin-top: 40px;
	}
</style>
